package cn.tedu.memory;

import cn.tedu.eunm.Sex;
import cn.tedu.pojo.User;

public class App {
	private static final ThreadLocal<User> tl = new ThreadLocal<>();
	
	public static User getApp() {
		User user = tl.get();
		if(user == null) {
			user = new User("admin", 18, Sex.MAN.getValue());
			tl.set(user);
		}else {
			user.setAge(user.getAge()+1);
			tl.set(user);
		}
		return user;
	}
}
